import request from '@/utils/request'

export function list(query) {
    return request({
        url: '/mallGoods/list',
        method: 'get',
        params: query
    })
}

export function info(id) {
    return request({
        url: '/mallGoods/info/' + id,
        method: 'get'
    })
}

export function save(goods,act,types,goodsQualificationEntity) {
    let data = {goods,act,types,goodsQualificationEntity};
    data.json=true

    return request({
        url: '/mallGoods/save',
        method: 'post',
        data
    })
}

export function update(goods,act,types,goodsQualificationEntity) {
    let data = {goods,act,types,goodsQualificationEntity};
    data.json=true
    return request({
        url: '/mallGoods/update',
        method: 'post',
        data
    })
}

export function remove(data) {
    return request({
        url: '/mallGoods/delete',
        method: 'post',
        data
    })
}

export function all() {
    let url = '/mallGoods/queryAll'
    return request.get(url)
}

export function updateStock(record) {
    let url = '/mallGoods/stock'
    let data = record
    return request.post(url,data)
}

//所有的分类
export function listType() {
    let type =0
    let params = {type}
    let url = '/mall/type/queryAll'
    return request.get(url,{params})
}

